Creating a Local Admin Account via CMD
Creating a local administrator account gives you a fallback login that is independent of your Microsoft Account and any Microsoft services. This is especially useful before making changes that could affect Microsoft Account authentication (such as disabling wlidsvc or blocking login.live.com).
You must run Command Prompt as Administrator for these commands to work. Right-click the Start menu → Terminal (Admin) or search for cmd, right-click → Run as administrator.
Step 1 — Create the User Account
net user /add [username] [password]
Replace [username] with your chosen account name and [password] with a strong password.
Example:
net user /add LocalAdmin MyStr0ngP@ss!
Avoid spaces in the username. If you need spaces, wrap the username in quotes: net user /add "My Admin" password.
Step 2 — Add the Account to the Administrators Group
net localgroup administrators [username] /add
Example:
net localgroup administrators LocalAdmin /add
This grants the new account full administrative privileges on the local machine.
Step 3 — Verify the Account
Confirm the account was created and is in the Administrators group:
net user [username]
Look for Local Group Memberships in the output — it should include *Administrators.
You can also list all members of the Administrators group:
net localgroup administrators
Signing In with the New Account
Once created, the account will appear on the Windows login screen. You can switch to it without restarting:
- Press
Win + Lto lock the screen - Click on the new username in the bottom-left corner of the login screen
- Enter the password you set in Step 1
Setting a Password (Optional — If You Want No Password)
Passwordless local accounts are a security risk, especially on shared or portable machines.
To create an account with no password, omit the password argument:
net user /add [username]
Removing the Account (Cleanup)
If you no longer need the local account, you can remove it:
net user /delete [username]
💬 Recent Comments